<!-- 单计量表单 -->
<template>
  <div>
    <a-form-item label="单位名称：">
      <a-input v-model="currForm.list.name"></a-input>
    </a-form-item>

    <a-form-item label="是否是主单位：">
      <a-radio-group v-model="currForm.list.isDefault">
        <a-radio :value="1">是</a-radio>
        <a-radio :value="2">否</a-radio>
      </a-radio-group>
    </a-form-item>
    <a-form-item label="是否启用：">
      <a-radio-group v-model="currForm.list.isEnable">
        <a-radio :value="1">是</a-radio>
        <a-radio :value="2">否</a-radio>
      </a-radio-group>
    </a-form-item>
    <a-form-item label="备注：">
      <a-textarea v-model="currForm.list.remark"> </a-textarea>
    </a-form-item>
  </div>
</template>

<script lang="ts" setup>
  import { computed, ref, reactive, watchEffect } from 'vue';
  import { cloneDeep } from 'lodash';

  const props = withDefaults(
    defineProps<{
      form?: any; // 传进来的数据
    }>(),
    {
      // form: undefined,
    }
  );
  const currForm = reactive({
    list: {
      name: '',
      isDefault: 1,
      isEnable: 1,
      remark: '',
    },
  });

  watchEffect(() => {
    currForm.list = cloneDeep(props.form);
  })
  // 将对象导出
  defineExpose({ currForm });
</script>

<style scoped lang="less"></style>
